/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.wpi.first.wpilibj.templates.commands;

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj.templates.OI;
        
/**
 *
 * @author Robotics
 */
public class ToggleController extends CommandBase {
    
    private boolean isDone = false;
    
    public ToggleController() {
        // Use requires() here to declare subsystem dependencies
        // eg. requires(chassis);
    }

    // Called just before this Command runs the first time
    protected void initialize(){
        isDone = false;
    }

    // Called repeatedly when this Command is scheduled to run
    protected void execute(){
        //oi.changeControllerLayout(!oi.isJoystick());
        oi.setJoystick(!oi.isJoystick());
        if(oi.isJoystick()){
            SmartDashboard.putString("Controller Type: ", "Joystick");
        }else{
            SmartDashboard.putString("Controller Type: ", "X-Box");
        }
        isDone = true;
    }

    // Make this return true when this Command no longer needs to run execute()
    protected boolean isFinished() {
        return isDone;
    }

    // Called once after isFinished returns true
    protected void end(){
        
    }

    // Called when another command which requires one or more of the same
    // subsystems is scheduled to run
    protected void interrupted() {
    }
}
